package io.kiki.sba.registry.server.shared.meta;

import io.kiki.sba.registry.api.exchange.RequestException;
import io.kiki.sba.registry.api.exchange.message.Response;
import io.kiki.sba.registry.common.model.elector.Leader;


public interface CentralControlLeaderExchanger {

    /**
     * send request to remote cluster meta leader
     */
    Response sendRequest(String dataCenter, Object requestBody) throws RequestException;

    /**
     * learn leader from remote resp
     * <p>
     * r
     */
    boolean learn(String dataCenter, Leader leader);

    /**
     * reset leader from remoteMetaDomain
     */
    Leader resetLeader(String dataCenter);

    /**
     * get leader info
     */
    Leader getLeader(String dataCenter);

    /**
     * remove leader
     */
    void removeLeader(String dataCenter);
}
